import request, { extend } from 'umi-request';


const res = extend({
  prefix: "/api",
  timeout: 5000,
  headers: {
    "Content-Type": "application/json",

  },

});
export interface SupplyListInter {
  currentPage: number;
  pageSize: number;
}

//供应大厅-商品信息
export async function getInformation(body: API.getInformationDto) {
  return res('/commodityInformation/getInformation',
    {
      method: 'post',
      data: body
    })
}
//供应大厅-一级菜单
export async function tabType() {
  return res('/menu/getFirst',
    {
      method: 'get'
    })
}
//供应大厅-二级菜单
export async function tabThird(body: string) {
  return res(`/menu/getMenu/${body}`,
    {
      method: 'post',
      data: { level: body }
    })
}

//供应大厅-菜单查询
export async function getList(body: string) {
  return res(`/menu/getList/${body}`,
    {
      method: 'post',
      data: { menuName: body }
    })
}
//供应大厅-信息查询Id
export async function getInformationById(body: string) {
  return res(`/commodityInformation/getInformation/${body}`,
    {
      method: 'get',
      params: { id: body }
    })
}
//商品信息-取消发布
export async function getDeleteInformation(body: string) {
  return res(`/commodityInformation/deleteInformation/${body}`,
    {
      method: 'delete',
      params: { id: body }
    })
}

//采购订单-订单信息
export async function getByPurchaserId(body: API.getByPurchaserId) {
  return res('/commodityOrder/getByPurchaserId',
    {
      method: 'get',
      params: body
    })
}
//采购订单-订单详情Id
export async function getPurchaserOrder(body: string) {
  return res(`/commodityOrder/getPurchaserCommodityOrder/${body}`,
    {
      method: 'get',
      params: { id: body }
    })
}

//发布供应-发布记录
export async function getStatusQuery(body: API.getStatusQuery) {
  return res('/commodityInformation/getStatusQuery',
    {
      method: 'post',
      data: body
    })
}

//商品订单-新增
export async function getPurchaserAdd(body: API.commodityOrderAddDto) {
  return res('/commodityOrder/purchaserAdd',
    {
      method: 'post',
      data: body
    })
}

//商品订单-取消订单
export async function getCancel(idString: number) {
  return res(`/commodityOrder/cancel/${idString}`,
    {
      method: 'put',
      data: idString
    })
}

//商品订单-删除订单
export async function getRemove(idString: number) {
  return res(`/commodityOrder/remove/${idString}`,
    {
      method: 'delete',
      data: idString
    })
}

//供应方-电话查询
export async function getUserPhone(body: string) {
  return res(`/user/displayContactInfo`,
    {
      method: 'get',
      params: { id: body }
    })
}

//发票订单-订单详情Id
export async function getQueryBillById(body: string) {
  return res(`/bill/queryBillById/${body}`,
    {
      method: 'get',
      params: { billOrderPhone: body }
    })
}

